from rtcCVTransform.videoTrans_Base import videoTransformBase
import numpy as np
import av
import cv2


class videoTransEdgeDetect(videoTransformBase):

    def transform(self, frame: av.VideoFrame) -> np.ndarray:
        print("接收到图片：。。。。")
        img = frame.to_ndarray(format="bgr24")
        img = cv2.cvtColor(cv2.Canny(img, 100, 200), cv2.COLOR_GRAY2BGR)
        return img

